import axios from 'axios';

/**
 * get请求；
*/
export const AxiosGet = (url, callback) => {
	axios.get(url)
	    .then(function (response) {
			callback(response);
	    })
	    .catch(function (error) {
	        alert(error);
	    });
}
/**
 * post请求；
*/
export const AxiosPost = (url, parsms, callback) => {
	axios.post(url, {
		params
	})
	.then(function (response) {
		callback(response);
	})
	.catch(function (error) {
		alert(error);
	});
}
/**
 * 适用于post和get的请求；
*/
export const Axios = (method, url, params, callback) => {
	axios[method](url, {
		params
	})
	.then(function (response) {
		callback(response);
	})
	.catch(function (error) {
		alert(error);
	});
}